use super::solution::Solution;


impl Solution {
    pub fn minimum_operations(nums: Vec<i32>) -> i32 {
        let mut dp =[0].repeat(4);
        let len =nums.len();
        for num in nums{
            dp[num as usize]+=1;
            dp[2]=i32::max(dp[1],dp[2]);
            dp[3]=i32::max(dp[3],dp[2]);
        }
        return  len as i32-dp[3];
      
    }
}